import React, { Component } from 'react';
import {
    View,
    Text,
    ListView,
} from 'react-native';


import { mapgoStyle as styles } from '../../../styles';
var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;


const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
export default class Bicycle_route extends Component {
    // 初始化模拟数据
    constructor(props) {
        super(props);
      }
    render() {
        let steps = [];
        if(this.props.Line){
            steps = this.props.Line.bikingSteps;
        }
        let dataSource = ds.cloneWithRows(steps)
        return (
            <View style={styles.go_rall}>
                {this.props.isPassDay?<Text>太远了，别折腾啦~！</Text>:
                <ListView
                    enableEmptySections={true}
                    dataSource={dataSource}
                    renderRow={this.renderRow.bind(this)}
                    contentContainerStyle={{width:width*0.9}}
                />}
            </View>
        );
    }



    renderRow(rowData) {
        return (
            <View style={styles.go_spe}>
                <Text style={styles.go_circle}></Text>
                <Text style={styles.go_on}>{rowData.instructions?rowData.instructions:null}</Text>
            </View>
        )
    }
}